package com.huashi.dealer.commonEntity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * 自提订单联系方式记录表
 */
@Data
@TableName("yoshop_order_extract")
@Schema(description = "自提订单联系方式记录表")
public class OrderExtract {
    @TableId(value = "id", type = IdType.AUTO)
    @Schema(description = "主键id")
    private Integer id;

    @TableField("order_id")
    @Schema(description = "订单id")
    private Integer orderId;

    @TableField("linkman")
    @Schema(description = "联系人姓名")
    private String linkman;

    @TableField("phone")
    @Schema(description = "联系电话")
    private String phone;

    @TableField("user_id")
    @Schema(description = "用户id")
    private Integer userId;

    @TableField("wxapp_id")
    @Schema(description = "小程序id")
    private Integer wxappId;

    @TableField("create_time")
    @Schema(description = "创建时间")
    private Long createTime;
    @Schema(description = "创建时间")
    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTimeFormat;


    public void setCreateTime(Long createTime) {
        this.createTime = createTime;
        this.setCreateTimeFormat(LocalDateTime.ofEpochSecond(createTime, 0, java.time.ZoneOffset.ofHours(8)));
    }
} 